package com.spdzen.model;

import com.baomidou.mybatisplus.activerecord.Model;
import java.util.Date;

import javax.validation.constraints.Min;

import org.hibernate.validator.constraints.NotBlank;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.spdzen.support.validation.AddValidGroup;
import com.spdzen.support.validation.UpdateValidGroup;
import com.baomidou.mybatisplus.annotations.TableId;
import java.io.Serializable;

/**
 * <p>
 * 组织机构
 * </p>
 *
 * @author accountwcx@qq.com
 * @since 2017-03-16
 */
@TableName("spd_sys_dept")
public class SysDept extends Model<SysDept> {

	private static final long serialVersionUID = 1L;

	@TableId("id")
	@Min(value = 1L, groups = { UpdateValidGroup.class })
	private Long id;
	/**
	 * 上级部门，如果没有上级部门，值为0
	 */

	@TableField("parent_id")
	private Long parentId;
	/**
	 * 部门名称
	 */

	@TableField("name")
	@NotBlank(groups = { AddValidGroup.class, UpdateValidGroup.class })
	private String name;
	/**
	 * 部门编号，唯一
	 */

	@TableField("code")
	@NotBlank(groups = { AddValidGroup.class, UpdateValidGroup.class })
	private String code;
	/**
	 * 部门电话
	 */

	@TableField("phone")
	private String phone;
	/**
	 * 部门邮箱
	 */

	@TableField("email")
	private String email;
	/**
	 * 外键spd_base_city.id
	 */

	@TableField("base_city_id")
	private Integer baseCityId;
	/**
	 * 外键spd_base_county.id
	 */

	@TableField("base_county_id")
	private Integer baseCountyId;
	/**
	 * 详细地址
	 */

	@TableField("address")
	private String address;

	/**
	 * 部门排序，值越小越靠前
	 */
	@TableField("sort")
	private Integer sort;

	/**
	 * 操作时间
	 */

	@TableField("operate_time")
	private Date operateTime;
	/**
	 * 操作人id
	 */

	@TableField("operate_id")
	private Long operateId;

	public Long getId() {
		return id;
	}

	public SysDept setId(Long id) {
		this.id = id;
		return this;
	}

	public Long getParentId() {
		return parentId;
	}

	public SysDept setParentId(Long parentId) {
		this.parentId = parentId;
		return this;
	}

	public String getName() {
		return name;
	}

	public SysDept setName(String name) {
		this.name = name;
		return this;
	}

	public String getCode() {
		return code;
	}

	public SysDept setCode(String code) {
		this.code = code;
		return this;
	}

	public String getPhone() {
		return phone;
	}

	public SysDept setPhone(String phone) {
		this.phone = phone;
		return this;
	}

	public String getEmail() {
		return email;
	}

	public SysDept setEmail(String email) {
		this.email = email;
		return this;
	}

	public Integer getBaseCityId() {
		return baseCityId;
	}

	public SysDept setBaseCityId(Integer baseCityId) {
		this.baseCityId = baseCityId;
		return this;
	}

	public Integer getBaseCountyId() {
		return baseCountyId;
	}

	public SysDept setBaseCountyId(Integer baseCountyId) {
		this.baseCountyId = baseCountyId;
		return this;
	}

	public String getAddress() {
		return address;
	}

	public SysDept setAddress(String address) {
		this.address = address;
		return this;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public Date getOperateTime() {
		return operateTime;
	}

	public SysDept setOperateTime(Date operateTime) {
		this.operateTime = operateTime;
		return this;
	}

	public Long getOperateId() {
		return operateId;
	}

	public SysDept setOperateId(Long operateId) {
		this.operateId = operateId;
		return this;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

}